home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / ARGONET / PD / PROGRAMMING / DESKLIBC / SOURCES.ZIP / DeskLib / !DLSources / Libraries / Icon / c / AlterValid next >
Text File  |  1995-07-08  |  1KB  |  39 lines

  1. /*
  2.     ####             #    #     # #
  3.     #   #            #    #       #          The FreeWare C library for 
  4.     #   #  ##   ###  #  # #     # ###             RISC OS machines
  5.     #   # #  # #     # #  #     # #  #   ___________________________________
  6.     #   # ####  ###  ##   #     # #  #                                      
  7.     #   # #        # # #  #     # #  #    Please refer to the accompanying
  8.     ####   ### ####  #  # ##### # ###    documentation for conditions of use
  9.     ________________________________________________________________________
  10.  
  11.     File:    Icon.AlterValid.c
  12.     Author:  Copyright 1994 Tony Howat
  13.     Version: 1.00 (2 Aug 1994)
  14.     Purpose: Changes an icon's validation string - makes pressy slabbed
  15.              borders easy.
  16. */
  17.  
  18. #include <string.h>
  19.  
  20. #include "DeskLib:WimpSWIs.h"
  21. #include "DeskLib:Icon.h"
  22.  
  23.  
  24. extern void Icon_AlterValidation(window_handle window, icon_handle icon,
  25.                                     char *newvalidation)
  26. {
  27.   icon_block wimpicon;
  28.  
  29.   Wimp_GetIconState(window, icon, &wimpicon);
  30.  
  31.   if (!strcmp(wimpicon.data.indirecttext.validstring, newvalidation))
  32.      return;
  33.  
  34.   strcpy(wimpicon.data.indirecttext.validstring, newvalidation);
  35.       
  36.   Wimp_SetIconState(window, icon, 0, 0);
  37. }
  38.  
  39.